// 延期柱状图
export function postponenum(data) {
    return {
        title: {
            text: "延期数量",
            subtext: '当天为时间轴'
        },
        toolbox: {
            show: true,
            triggerOn: "mousemove",
            feature: {
                magicType: { type: ['line', 'bar'] },
                restore: {},
                saveAsImage: {}
            }
        },
        tooltip: {},
        xAxis: {
            data: data.date.day,
        },
        yAxis: {},
        series: [
            {
                markPoint: {
                    data: [
                        { type: 'max', name: '最大值' },
                        { type: 'min', name: '最小值' }
                    ]
                },
                markLine: {
                    data: [
                        { type: 'average', name: '平均值' }
                    ]
                },
                name: "本周延期数量",
                type: "bar",
                data: data.list,
            },
        ],
    }

}


// 延期饼状图
export function postponecake(data) {
    return {
        title: {
            text: '本期延期占比',
            subtext: '数据分析',
            left: 'center'
        },
        tooltip: {
            trigger: 'item',
            formatter: '{b} : {c} ({d}%)'
        },
        legend: {
            orient: 'vertical',
            left: 'left',
        },
        series: [
            {
                name: '占比',
                type: 'pie',
                radius: '70%',
                top: "20",
                data: data.list,
                // itemStyle: {
                //     normal: {
                //         label: {
                //             show: true,
                //             formatter: '{b} : {c} ({d}%)'
                //         },

                //         labelLine: { show: true }

                //     }
                // },
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    }

}

// 延期对比柱状图
export function postponecomparison(data) {
    return {
        title: {
            text: "延期对比",
            subtext: '统计'
        },
        toolbox: {
            show: true,
            triggerOn: "mousemove",
            feature: {
                magicType: { type: ['line', 'bar'] },
                restore: {},
                saveAsImage: {}
            }
        },
        tooltip: {},
        xAxis: {
            data: data.date,
        },
        yAxis: {},
        series: [
            {
                markPoint: {
                    data: [
                        { type: 'max', name: '最大值' },
                        { type: 'min', name: '最小值' }
                    ]
                },
                markLine: {
                    data: [
                        { type: 'average', name: '平均值' }
                    ]
                },
                name: "本周延期数量",
                type: "bar",
                data: data.list,
            },
        ],
    }

}

// 延期对比柱状图
export function postponeorder(data) {
    return {
        title: {
            text: "等待订单数",
            subtext: '当天时间为轴'
        },
        toolbox: {
            show: true,
            triggerOn: "mousemove",
            feature: {
                magicType: { type: ['line', 'bar'] },
                restore: {},
                saveAsImage: {}
            }
        },
        tooltip: {},
        xAxis: {
            data: data.date.day,
        },
        yAxis: {},
        series: [
            {
                markPoint: {
                    data: [
                        { type: 'max', name: '最大值' },
                        { type: 'min', name: '最小值' }
                       
                    ]
                },
                markLine: {
                    data: [
                        { type: 'average', name: '平均值' }
                    ]
                },
                name: "本周延期数量",
                type: "bar",
                data: data.list,
            },
        ],
    }

}
